import request from '@/utils/request'

export function addOrder(data) {
	return request({
		url: '/user/order/add',
		method: 'post',
		data: data
	})
}

export function prepayOrder(orderId, appId) {
	return request({
		url: '/user/order/prepay/' + appId,
		method: 'get',
		params: { orderId }
	})
}

export function paySuccess(orderId) {
	return request({
		url: '/user/order/pay-success',
		method: 'get',
		params: { orderId }
	})
}

export function payFail(orderId) {
	return request({
		url: '/user/order/pay-fail',
		method: 'get',
		params: { orderId }
	})
}

export function refundOrder(params, appId) {
	return request({
		url: '/user/order/refund/' + appId,
		method: 'get',
		params: params
	})
}

export function payForBalance(orderId) {
	return request({
		url: '/user/order/pay-balance',
		method: 'get',
		params: { orderId }
	})
}

export function getOrder(orderId) {
	return request({
		url: '/user/order/detail',
		method: 'get',
		params: { orderId }
	})
}

export function getOrderGoods(params) {
	return request({
		url: '/user/order/order-goods',
		method: 'get',
		params: params
	})
}